package com.esiag.isidis.fi.pdsteam.views;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JPanel;

public class Header extends JPanel implements ActionListener{
	private Frame_Scenario frame; 
	private JButton addButton=new JButton("Add");
	
	public JButton getAddButton() {
		return addButton;
	}
	public Header(Frame_Scenario frame) {
		super();
		this.frame=frame;
		addButton.addActionListener(this);
		add(addButton);
		addLine();
	}
	private void addLine(){
		JPanel lines= frame.getLinesContainer();
		JPanel p=new JPanel();
		p.add(new LabledCombo("Sensor type", 50));
		p.add(new LabledTextField("Event count", 50, 5));
		p.add(new LabledTextField("Wait time", 50, 5));
		lines.add(p);
		frame.setVisible(true);
	}
	public void actionPerformed(ActionEvent e) {
		addLine();
	}

}
